Alembic Wrap:社区版数据库迁移工具封装
Alembic Wrap 是社区版 Alembic 封装,由 user_922b1001 发布,提供数据库迁移流程的封装能力,基于通用 SKILL.md 格式,适合需要快速集成迁移管理的开发者。
Read Moredsh-db-migration: SQL Generation Tool for Database Migration
`dsh-db-migration` is a pure Node.js tool maintained by uckkk for automatically comparing two SQL DDL files and generating schema change scripts. It supports detecting added, removed, or modified tables, columns, and types, covering common types such as `DECIMAL` and `ENUM`. Users can install it via `dsh plugin add` and enable it in `package.json`. The core tool, `diff_schema`, can automatically output `ALTER TABLE` or `DROP TABLE` statements. The tool is suitable for quickly generating migration scripts, but it does not handle foreign keys or complex constraints, and the generated SQL requires manual review to ensure safety.
Read MoreDeepSeek Harness Plugin Introduction: dsh-db-migration (Database Migration and Zero-Downtime Changes)
`satan9394/dsh-db-migration` is a DSH skill plugin designed to address the challenges of database migration in agent workflows. It supports migration, rollback, schema expansion and contraction, zero-downtime changes, and data consistency validation. Since specific installation commands and usage examples are not provided, users should visit the GitHub repository to review the source code. When using it, be mindful of permission compliance and environment requirements.
Read MoreBeginner-Friendly: Flask-Migrate Database Migration Tutorial
### Why Database Migration is Needed? As database structures evolve with changing requirements during development, manual modifications risk data loss or version chaos. Migration tools enable safe structural changes while preserving data, akin to "database version control." ### What is Flask-Migrate? It is a Flask extension built on Alembic, designed to manage database schema changes in conjunction with SQLAlchemy. It automatically generates migration scripts, eliminating the need for manual SQL writing. ### Installation and Initialization Install dependencies: `pip install flask flask-sqlalchemy flask-migrate`. Initialize: Set the `FLASK_APP` environment variable, then run `flask db init` to generate the `migrations` folder and define models (e.g., a `User` table). ### Core Migration Commands 1. **Initialize Migration Environment** (first time): `flask db init` generates the `migrations` folder. 2. **Generate Migration Script**: After modifying models, run `flask db migrate -m "description of changes"` to create the SQL script. 3. **Apply Migration**: Execute `flask db upgrade` to apply the changes. ### Practical Workflow 1. Modify the model (e.g., add an `age` field); 2. Generate the script: `
Read More